<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>投递简历</title>
    <style>
        .row{clear:both;width:98%;padding:10px;}
        .input-sm{width:100%; height: 5rem;line-height: 5rem;font-size:2rem;border:1px solid;}
        .select-sm{width:100%;height: 5rem;line-height: 5rem;font-size:2rem;border:1px solid;}
        .btn-sm{width:100%; height: 5rem;line-height: 5rem;font-size:2rem;}
    </style>
</head>
<body >
    <form id="rsmForm">
        <div class="row">
            <input placeholder="*姓名" class="input-sm" id="name" name="name">
        </div>
        <div class="row">
            <input placeholder="*手机" class="input-sm" id="mobile" name="mobile">
        </div>
        <div class="row">
            <input placeholder="*学校" class="input-sm" id="school" name="school">
        </div>
        <div class="row">
            <input placeholder="*期望工作" class="input-sm" id="expectJob" name="expectJob">
        </div>
        <div class="row">
            <select name="gender" class="select-sm" >
                <option value="FEMALE">女</option>
                <option value="MALE">男</option>
                <option value="UNKNOWN">不详</option>
            </select>
        </div>
        <div class="row">
            <select name="degree" class="select-sm" >
                <option value="BACHELOR">本科</option>
                <option value="SPECIAL">大专</option>
                <option value="HIGH">高中</option>
                <option value="JUNIOR">初中</option>
                <option value="PRIMARY">小学</option>
                <option value="MASTER">硕士</option>
                <option value="DOCTOR">博士</option>
                <option value="UNKNOWN">不详</option>
            </select>
        </div>
        <div class="row"  >
            <input type="email" placeholder="邮箱" class="input-sm" name="email">
        </div>
        <div class="row"  >
            <input placeholder="身份证号" class="input-sm" name="idCard">
        </div>
        <div class="row"  >
            <input type="button"  class="btn-sm" onclick="submitForm()" value="提交">
        </div>

    </form>
    <script src="http://koudaisoft.cn/static/jquery-2.0.3.min.js"></script>
    <script>
        function  submitForm() {
            var msg = "";
            if(!$("#name").val()){
                msg = msg + "姓名不能为空\n";
            }
            if(!$("#mobile").val()){
                msg = msg + "手机不能为空\n";
            }else{
                var reg = RegExp("1[0-9]{10}$");
                if(!reg.test($("#mobile").val())){
                    msg = msg + "手机格式不正确\n";
                }
            }
            if(!$("#school").val()){
                msg = msg + "学校不能为空\n";
            }
            if(!$("#expectJob").val()){
                msg = msg + "期望工作不能为空\n";
            }
            if(msg){
                alert(msg);
                return false;
            }

            $.post("http://koudaisoft.cn/wxs/rsm/fill/gc_sh",  $("#rsmForm").serialize(),function( result ){
               alert(result);
            });

        }
    </script>
</body>
</html>
